package org.uim.cricket.storage;

import java.io.FileReader;
import java.util.Properties;

public class StorageProperties {

	public static String propFile = "../config/storage.properties";
	
	private static Properties prop = null;
	
	public static void load() throws Exception {
		prop = new Properties();
		prop.load(new FileReader(propFile)); 
	}
	
	public static String getValue(String key) {
		return prop.getProperty(key);
	}
	
	public static boolean getBoolValue(String key) {
		String val = getValue(key);
		if (val == null) return false;
		if (val.equalsIgnoreCase("yes") || val.equalsIgnoreCase("true")) return true;
		return false;
	}
	
	public static void setPropFile(String propFile) {
		StorageProperties.propFile = propFile;
	}
	
	public static String getPropFile() {
		return propFile;
	}
	
	public static Properties getProp() {
		return prop;
	}
	
}
